package com.java65;

import java.util.Scanner;

public class practice7 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
            String username ="manage";
            int password = 0000;
            for(int i =3;i>=1;i--){
                System.out.println("请输入用户名:");
                String name =input.next();
                System.out.println("请输入密码:");
                int pw =input.nextInt();
                if(name.equals(username)&&pw==password){
                    System.out.println("欢迎进入购物管理系统");
                    break;
                }
                else if(i!=1){
                    System.out.println("用户名和密码不匹配！");
                    System.out.println("你还有"+(i-1)+"次机会，请重新输入:");
                }
                else {
                    System.out.println("您没有权限进入系统!");
                }
            }
        }
    }
